import "reflect-metadata"

(function(){
	function Test(n){
		return (target: any, fnkey: string, index:number) => {
			console.log("n,fnkey,index",n,fnkey,index)
			
			// const args = Reflect.getMetadata("aaa", target, fnkey) || [];
			// args.push(index)
			// Reflect.defineMetadata("aaa",n,target,fnkey);
			// console.log("args",args)
		}
	}
	
	function Test1(aaa: any) {
		return function (target: any, key: string): any {
			console.log("target",target)
			Reflect.defineMetadata("aaa",aaa,target,key);
		}
	}
	
	
	class A{
		@Test1(124413123)
		aaa:string
		
		fn1(@Test(1) a:any,@Test(2) b:any){
			return a
		}
	}
	
	// var a = new A({a:"1231"})
	// var a = new A()
	console.log("A.prototype",Reflect.getMetadata("aaa", A.prototype, 'aaa'))
	console.log("new A()",Reflect.getMetadata("aaa", new A(), 'aaa'))
	
	// console.log("a=",a)
	// console.log("a.b=",a.b)
	// console.log("a.aaa",a.aaa)
	
})()